package com.rs.game.player.dialogues;

public class Bob extends Dialogue {

	int npcId;

	@Override
	public void start() {
		npcId = (int) parameters[0];
		sendNPCDialogue(npcId, Expressions.HAPPY_TALKING, "Hello there! How may I help you?");
	}

	@Override
	public void run(int interfaceId, int componentId) {
		switch (stage) {
		case -1:
			stage = 0;
			sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE, "Can you fix my armour?", "Nevermind.");
			break;
		case 0:
			switch (componentId) {
			case OPTION_1:
				sendPlayerDialogue(Expressions.NORMAL, "Can you fix my armour?");
				stage = 1;
				break;
			case OPTION_2:
				end();
				break;
			}
			break;
		case 1:
			sendNPCDialogue(npcId, Expressions.HAPPY_TALKING, "Yeah, I can fix pretty much anything, what is it you need fixing?");
			stage = 2;
			break;
		case 2:
			sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE, "Zaros armour.", "Barrows armour.");
			stage = 3;
			break;
		case 3:
			switch (componentId) {
			case OPTION_1:
				if (player.getInventory().containsItem(20138, 1) || player.getInventory().containsItem(20142, 1) || player.getInventory().containsItem(20146, 1) || player.getInventory().containsItem(20150, 1) || player.getInventory().containsItem(20154, 1) || player.getInventory().containsItem(20158, 1) || player.getInventory().containsItem(20162, 1) || player.getInventory().containsItem(20166, 1) || player.getInventory().containsItem(20170, 1) || player.getInventory().containsItem(20174, 1) || player.getInventory().containsItem(24985, 1) || player.getInventory().containsItem(24979, 1) || player.getInventory().containsItem(24991, 1) || player.getInventory().containsItem(24976, 1) || player.getInventory().containsItem(24988, 1) || player.getInventory().containsItem(24982, 1)) {
					sendPlayerDialogue(Expressions.NORMAL, "I have some ancient equipment that needs fixing, can you do it?");
					stage = 4;
				} else {
					sendPlayerDialogue(Expressions.SAD, "I don't seem to have the equipment on me at the moment, I'll come back once I have it.");
					stage = 12;
				}
				break;
			case OPTION_2:
				if (player.getInventory().containsItem(4884, 1) || player.getInventory().containsItem(4890, 1) || player.getInventory().containsItem(4896, 1) || player.getInventory().containsItem(4902, 1) || player.getInventory().containsItem(4860, 1) || player.getInventory().containsItem(4866, 1) || player.getInventory().containsItem(4872, 1) || player.getInventory().containsItem(4878, 1) || player.getInventory().containsItem(4908, 1) || player.getInventory().containsItem(4914, 1) || player.getInventory().containsItem(4920, 1) || player.getInventory().containsItem(4926, 1) || player.getInventory().containsItem(4932, 1) || player.getInventory().containsItem(4938, 1) || player.getInventory().containsItem(4944, 1) || player.getInventory().containsItem(4950, 1) || player.getInventory().containsItem(21742, 1) || player.getInventory().containsItem(21750, 1) || player.getInventory().containsItem(21758, 1) || player.getInventory().containsItem(21766, 1)) {
					sendPlayerDialogue(Expressions.NORMAL, "I have some barrows equipment that needs fixing, can you do it?");
					stage = 8;
				} else {
					sendPlayerDialogue(Expressions.SAD, "I don't seem to have the equipment on me at the moment, I'll come back once I have it.");
					stage = 12;
				}
				break;
			}
			break;
		case 4:
			sendNPCDialogue(npcId, Expressions.NORMAL, "This looks tricky, but I'm sure I can fix it. But it will cost you 10,000,000 coins a piece.");
			stage = 5;
			break;
		case 5:
			sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE, "Sure no problem!", "That is way too much!");
			stage = 6;
			break;
		case 6:
			switch (componentId) {
			case OPTION_1:
				if (player.getInventory().containsItem(995, 10000000)) {
					sendPlayerDialogue(Expressions.HAPPY_TALKING, "Sure no problem!");
					stage = 7;
				} else {
					sendPlayerDialogue(Expressions.SAD, "I don't seem to have enough money on me at the moment I will be back once I get some.");
					stage = 12;
				}
				break;
			case OPTION_2:
				sendPlayerDialogue(Expressions.ANGRY, "That is way too much!");
				stage = 12;
				break;
			}
			break;
		case 7:
			sendNPCDialogue(npcId, Expressions.HAPPY_TALKING, "There you go! Good as new!");
			if (player.getInventory().containsItem(20138, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(20138, 1);
				player.getInventory().addItem(20135, 1);
			} else if (player.getInventory().containsItem(20142, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(20142, 1);
				player.getInventory().addItem(20139, 1);
			} else if (player.getInventory().containsItem(20146, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(20146, 1);
				player.getInventory().addItem(20143, 1);
			} else if (player.getInventory().containsItem(20150, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(20150, 1);
				player.getInventory().addItem(20147, 1);
			} else if (player.getInventory().containsItem(20154, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(20154, 1);
				player.getInventory().addItem(20151, 1);
			} else if (player.getInventory().containsItem(20158, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(20158, 1);
				player.getInventory().addItem(20155, 1);
			} else if (player.getInventory().containsItem(20162, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(20162, 1);
				player.getInventory().addItem(20159, 1);
			} else if (player.getInventory().containsItem(20166, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(20166, 1);
				player.getInventory().addItem(20163, 1);
			} else if (player.getInventory().containsItem(20170, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(20170, 1);
				player.getInventory().addItem(20167, 1);
			} else if (player.getInventory().containsItem(20174, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(20174, 1);
				player.getInventory().addItem(20171, 1);
			}else if (player.getInventory().containsItem(24985, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(24985, 1);
				player.getInventory().addItem(24983, 1);
			}else if (player.getInventory().containsItem(24979, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(24979, 1);
				player.getInventory().addItem(24977, 1);
			}else if (player.getInventory().containsItem(24991, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(24991, 1);
				player.getInventory().addItem(24989, 1);
			}else if (player.getInventory().containsItem(24976, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(24976, 1);
				player.getInventory().addItem(24974, 1);
			}else if (player.getInventory().containsItem(24988, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(24988, 1);
				player.getInventory().addItem(24986, 1);
			}else if (player.getInventory().containsItem(24982, 1) && player.getInventory().containsItem(995, 10000000)) {
				player.getInventory().deleteItem(995, 10000000);
				player.getInventory().deleteItem(24982, 1);
				player.getInventory().addItem(24980, 1);
			}
			stage = 12;
			break;
		case 8:
			sendNPCDialogue(npcId, Expressions.HAPPY_TALKING, "I fix these almost everday. But it will cost you 5,000,000 coins a piece.");
			stage = 9;
			break;
		case 9:
			sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE, "Sure no problem!", "That is way too much!");
			stage = 10;
			break;
		case 10:
			switch (componentId) {
			case OPTION_1:
				if (player.getInventory().containsItem(995, 10000000)) {
					sendPlayerDialogue(Expressions.HAPPY_TALKING, "Sure no problem!");
					stage = 11;
				} else {
					sendPlayerDialogue(Expressions.SAD, "I don't seem to have enough money on me at the moment I will be back once I get some.");
					stage = 12;
				}
				break;
			case OPTION_2:
				sendPlayerDialogue(Expressions.ANGRY, "That is way too much!");
				stage = 12;
				break;
			}
			break;
		case 11:
			sendNPCDialogue(npcId, Expressions.HAPPY_TALKING, "There you go! Good as new!");
			if (player.getInventory().containsItem(4884, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4884, 1);
				player.getInventory().addItem(4716, 1);
			} else if (player.getInventory().containsItem(4890, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4890, 1);
				player.getInventory().addItem(4718, 1);
			} else if (player.getInventory().containsItem(4896, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4896, 1);
				player.getInventory().addItem(4720, 1);
			} else if (player.getInventory().containsItem(4902, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4902, 1);
				player.getInventory().addItem(4722, 1);
			} else if (player.getInventory().containsItem(4860, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4860, 1);
				player.getInventory().addItem(4708, 1);
			} else if (player.getInventory().containsItem(4866, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(13892, 1);
				player.getInventory().addItem(4710, 1);
			} else if (player.getInventory().containsItem(4872, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4872, 1);
				player.getInventory().addItem(4712, 1);
			} else if (player.getInventory().containsItem(4878, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4878, 1);
				player.getInventory().addItem(4714, 1);
			} else if (player.getInventory().containsItem(4908, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4908, 1);
				player.getInventory().addItem(4724, 1);
			} else if (player.getInventory().containsItem(4914, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4914, 1);
				player.getInventory().addItem(4726, 1);
			} else if (player.getInventory().containsItem(4920, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4920, 1);
				player.getInventory().addItem(4728, 1);
			} else if (player.getInventory().containsItem(4926, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4926, 1);
				player.getInventory().addItem(4730, 1);
			} else if (player.getInventory().containsItem(4932, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4932, 1);
				player.getInventory().addItem(4732, 1);
			} else if (player.getInventory().containsItem(4938, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4938, 1);
				player.getInventory().addItem(4734, 1);
			} else if (player.getInventory().containsItem(4944, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4944, 1);
				player.getInventory().addItem(4736, 1);
			} else if (player.getInventory().containsItem(4950, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(4950, 1);
				player.getInventory().addItem(4738, 1);
			} else if (player.getInventory().containsItem(21742, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(21742, 1);
				player.getInventory().addItem(21736, 1);
			} else if (player.getInventory().containsItem(21750, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(21750, 1);
				player.getInventory().addItem(21744, 1);
			} else if (player.getInventory().containsItem(21758, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(21758, 1);
				player.getInventory().addItem(21752, 1);
			} else if (player.getInventory().containsItem(21766, 1) && player.getInventory().containsItem(995, 5000000)) {
				player.getInventory().deleteItem(995, 5000000);
				player.getInventory().deleteItem(21766, 1);
				player.getInventory().addItem(21760, 1);
			}
			stage = 12;
			break;
		case 12:
			end();
			break;
		default:
			end();
			break;
		}
	}

	@Override
	public void finish() {

	}

}